import axios from '../utils/request.js'
export const artList = () => {
  return axios({
    url: '/my/cate/list',
    method: 'get'
  })
}
// 添加数据(后期写的备注,不知道对不对)
export const reqAddArticle = (data) => {
  return axios({
    url: '/my/cate/add',
    method: 'post',
    data
  })
}
// 文章分类里面的删除数据请求
export const deleateArticle = (id) => {
  return axios({
    url: '/my/cate/del?id=' + id,
    method: 'delete'
  })
}
// 文章分类里面的更新数据请求
export const infoArticle = (row) => {
  return axios({
    url: '/my/cate/info',
    method: 'put',
    data: row
  })
}

// 文章列表请求数据
export const reqGetlistArticle = q => {
  return axios({
    url: '/my/article/list',
    method: 'GET',
    params: q
  })
}
// 封装获取文章详情
export const reqGetArtInfo = id => {
  return axios({
    method: 'get',
    url: '/my/article/info',
    params: {
      id
    }
  })
}
// 封装数据
export const Btnarticle = id => {
  return axios({
    method: 'post',
    url: '/my/article/add',
    data: id
  })
}
// 更新用户的基本信息
export const BtnForm = id => {
  return axios({
    method: 'put',
    url: '/my/userinfo',
    data: id
  })
}
// 更新用户密码
export const pwdForm = data => {
  return axios({
    method: 'patch',
    url: '/my/updatepwd',
    data
  })
}
